
import React, {Component} from 'react';
import { DeviceEventEmitter } from 'react-native'
import { DeviceStorage } from "./utils/DeviceStorage";
import { createAppContainer, createStackNavigator, createSwitchNavigator } from 'react-navigation'
import TabNavigationBottom from './components/tabBarBottom/TabBarBottom'
import Welcome from './views/welcome/Welcome'
import Login from './views/login/Login'
import Register from './views/login/register/Register'
import Forgot from './views/login/forgot/Forgot'
import GoogleVerify from './views/login/google-verify/GoogleVerify'
import I18n from 'react-native-i18n'
import pages from './views/pages'
import { i18n } from "./utils/locales/i18n";


type Props = {};
export default class App extends Component<Props> {
    constructor(props) {
        super(props)
        this.state = {
            refresh: false
        }
    }

    render() {
        return <RootStack/>
    }
}

const LoginStack = createStackNavigator({
    Login: {
        screen: Login
    },
    Register: {
        screen: Register
    },
    Forgot: {
        screen: Forgot
    },
    GoogleVerify: {
        screen: GoogleVerify
    }
}, {
    initialRouteName: 'Login'
})

// 主导航（欢迎页，主界面，登录注册）
const RootNavigator = createSwitchNavigator(
    {
        // Welcome: {
        //     screen: Welcome
        // },
        LoginScreen: {
            screen: LoginStack
        },
		AppScreen: {
        	screen: TabNavigationBottom
        }
    },
    {
        initialRouteName: 'LoginScreen'
    }
);
const RootStack = createAppContainer(RootNavigator);

